package com.example.mybatistest.controller;

import com.example.mybatistest.dto.FzbSearchDto;
import com.example.mybatistest.entity.FzbEntity;
import com.example.mybatistest.service.ITestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/aa")
public class HelloWorld {

    @Autowired
    ITestService testService;

    @RequestMapping("/bb")
    @ResponseBody
    public String hell() {
        FzbEntity rec = new FzbEntity();
        rec.setTf("310");
        rec.setOwno("GOBW515");
        List<FzbEntity> list = testService.select(rec);
        StringBuffer sb = new StringBuffer();
        list.forEach(v->{
            sb.append(v.getTf());
        });


        FzbSearchDto dto = new FzbSearchDto();
        dto.setTf("310");
        dto.setOwno("GOBW515");
        list = testService.select(dto);

        return sb.toString();
    }
}
